import request from '@/utils/request'
const prefixUrl = process.env.VUE_APP_SUPERSET_SERVER

/**
 * @description 统计事件获取
 */
export function getDashboardId (params) {
  return request({
    url: `${prefixUrl}api/v1/dashboard`,
    method: 'get',
    params
  })
}
/**
 * @description 获取dashboard
 * http://192.168.88.247:4999/web/#/255/2176
 */
export function getDashboardIds (params) {
  return request({
    url: `${prefixUrl}api/v1/dashboards`,
    method: 'get',
    params
  })
}
/**
 * @description 获取dashboard下的charts
 * http://192.168.88.247:4999/web/#/255?page_id=2848
 */
export function getDataSources (params) {
  return request({
    url: `${prefixUrl}api/v1/dashboards/charts`,
    method: 'get',
    params
  })
}
/**
 * @description 统计事件获取
 */
export function getAllStatEvents (id = 1) {
  return request({
    url: `${prefixUrl}api/v1/dashboard/${id}/charts`
  })
}
